import React from "react";
import {
  BrowserRouter as Router,
  Routes,
  Route,
  Navigate,
} from "react-router-dom";
import "./index.scss";


import Home from "./home/home";
import My from "./my/my";
import Target from "./target/target";
import TargetList from "./target/list";
import TargetDetail from "./target/detail";

import Demo from "./demo/demo";
import Discover from "./discover/discover";
import Login from "./login/login";
import Zuji from "./zuji/zuji";
import Love from "./love/love";
import Set from "./set/set";
import Demand from "./demand/demand";

function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Navigate to="/home" />} />
        <Route path="/home" element={<Home />} />
        <Route path="/my" element={<My />} />
        <Route path="/target" element={<Target />}>
          {/* 子路由配置 */}
          <Route index element={<TargetList />} />
          <Route path="detail" element={<TargetDetail />} />
        </Route>
        <Route path="/discover" element={<Discover />} />
        <Route path="/login" element={<Login />} />
        <Route path="/love" element={<Love />} />
        <Route path="/zuji" element={<Zuji />} />
        <Route path="/set" element={<Set />} />
        <Route path="/demand" element={<Demand />} />
        <Route path="/demo" element={<Demo />} />
      </Routes>

      
    </Router>
  );
}

export default App;
